/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package EmployeeManagement;

import DatabaseConn.SQLBroker;
import java.sql.*;
import java.util.Iterator;
import java.util.Map;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author anvil
 */
public class EmployeeFunctions {

    private final Connection connection = null;
    private final SQLBroker sb = new SQLBroker();

    public String addEmployeeTable(Vector<String> v) {
        String tablestring = null;
        int x = 0;
        while (!v.isEmpty()) {
            tablestring+="<tr><td>"+v.get(x)+"</td><td><input type=\"text\" name=\""+v.get(x)+"\"></td></tr>";
            x++;
        }

        return tablestring;
    }

    public String getEmployeeTable() {
        String tablestring = null;
        try {

            sb.connect();

            PreparedStatement pst = connection.prepareStatement("");
            ResultSet rs = pst.executeQuery();

            int i = 0;
            while (rs.next()) {
                tablestring += "<td>" + rs.getString(i) + "</td>";
                i++;
            }

        } catch (SQLException ex) {
            Logger.getLogger(SQLBroker.class.getName()).log(Level.SEVERE, null, ex);
        }
        sb.close();
        return tablestring;
    }

    public boolean modifyEmployee(String empid) {
        return false;
    }

    public boolean terminateEmployee(String empid) {
        return true;
    }

    public boolean addEmployee() {
        return true;
    }

    public String employeeSearch(String empid) {
        return "employee";
    }

    public String employeeSearchFirstName(String firstName) {
        return "employee";
    }

    public String employeeSearchLastName(String lastName) {
        return "employee";
    }

}
